<div class="panel-body">
    <div class="table-responsive">
        <table class="table table-striped table-hover">
            <thead>
            <tr>
                <g:sortableColumn property="name" title="名称"/>
                <g:sortableColumn property="workflow" title="工作流"/>
                <g:sortableColumn property="stage" title="当前阶段"/>
                <g:sortableColumn property="status" title="当前状态"/>
                <g:sortableColumn property="createdDate" title="创建时间"/>
                <g:sortableColumn property="modifiedDate" title="修改时间"/>
                <g:sortableColumn property="operation" class="text-center" title="操作"/>
            </tr>
            </thead>
            <tbody>
            <g:each in="${workflowInstanceList}">
                <tr>
                    <td>
                      <sec:ifAllGranted roles="ROLE_ADMINISTRATOR">
                      <g:link controller="workflowInstance" action="show"
                                id="${it?.id}">${it?.name}</g:link>
                      </sec:ifAllGranted>
                      <sec:ifNotGranted roles="ROLE_ADMINISTRATOR">
                      ${it?.name}
                      </sec:ifNotGranted>
                    </td>
                    <td>${it?.workflow?.name}</td>
                    <td>${it?.stage?.name}</td>
                    <td>${it?.status?.name}</td>
                    <td>${it?.createdDate}</td>
                    <td>${it?.modifiedDate}</td>
                    <td class="text-center">
                      <g:link class="btn btn-info btn-xs" controller="workflowInstance" id="${it?.id}"
                              action="reject"><i class="fa fa-arrow-up"></i> 上一步</g:link>
                      <g:link class="btn btn-info btn-xs" controller="workflowInstance" id="${it?.id}"
                              action="approve"><i class="fa fa-arrow-down"></i> 下一步</g:link>
                      <g:link class="btn btn-danger btn-xs" controller="workflowInstance" id="${it?.id}"
                                      action="cancel"><i class="fa fa-exclamation-circle"></i> 失败</g:link>
                      <g:link class="btn btn-success btn-xs" controller="workflowInstance" id="${it?.id}"
                              action="complete"><i class="fa fa-check"></i> 完成</g:link>
                    </td>
                </tr>
            </g:each>
            </tbody>
        </table>
    </div>
</div>
